<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;

// Banner
Route::get('api/:version/banner/:id','api/:version.Banner/getBanner');


// Theme
// f.cn/api/v1/theme?ids=1,2
Route::get('api/:version/theme','api/:version.Theme/getThemes');

Route::get('api/:version/theme/:id','api/:version.Theme/getBooksWithTheme');


// Book  getList
// f.cn/api/v1/book/1
Route::get('api/:version/book/:id','api/:version.Book/getByID',[],['id'=>'\d+']);

Route::get('api/:version/books','api/:version.Book/getList');

// f.cn/api/v1/book?isbn=9787559410634
Route::get('api/:version/book','api/:version.Book/getByISBN');

// f.cn/api/v1/search?key=C++
Route::get('api/:version/search','api/:version.Book/searchKey');

// f.cn/api/v1/book/new?num=3
// Route::get('api/:version/book/new','api/:version.Book/getNew');

// f.cn/api/v1/book/by_category/2
Route::get('api/:version/book/by_category/:id','api/:version.Book/getByCategory');

// f.cn/api/v1/book/new_in_category?id=2&num=5
// Route::get('api/:version/book/new_in_category','api/:version.Book/getNewInCategory');


// Category
Route::get('api/:version/categories','api/:version.Category/getCategoryList');


// Token
Route::post('api/:version/token/user','api/:version.Token/get');

Route::post('api/:version/token/verify','api/:version.Token/verify');

Route::post('api/:version/token/app','api/:version.Token/getAppToken');


/* header 携带 token*/

// Address
Route::post('api/:version/address','api/:version.Address/newAddress');
Route::get('api/:version/address','api/:version.Address/getAddress');


//Order
// f.cn/api/v1/order/5
Route::get('api/:version/order/:id','api/:version.Order/getDetail',[],['id'=>'\d+']);


Route::post('api/:version/order','api/:version.Order/placeOrder');

// f.cn/api/v1/order/list
Route::get('api/:version/order/list','api/:version.Order/getList');


Route::get('api/:version/order/paginate','api/:version.Order/pageOrder');

// Route::put('api/:version/order/express/buy/:id','api/:version.Order/expressBuyOrder');

// Route::put('api/:version/order/express/recycle/:id','api/:version.Order/expressRecycleOrder');



// wx pay
Route::post('api/:version/pay/pre_order','api/:version.Pay/getPreOrder');

Route::post('api/:version/pay/notify','api/:version.Pay/receiveNotify');


// virtual pay   ?id =
Route::post('api/:version/pay/recycle','api/:version.Pay/RecyclePay');

Route::post('api/:version/pay/buy','api/:version.Pay/BuyPay');

// 余额
Route::get('api/:version/user/money','api/:version.Pay/getMoneyRecords');
// Route::post('cms/pages/token/app','api/v1.Token/getAppToken');

// http://f.cn/cms/pages/token/app


// express  发货
Route::post('api/:version/express/recycle','api/:version.Express/expressRecycle');
Route::post('api/:version/express/buy','api/:version.Express/expressBuy');


// message  模版消息发送   recycle  订单打款后
// Route::post('api/:version/express/recycle','api/:version.Express/expressRecycle');

